<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">
       <button @click="handler">修改数组数据</button>
        <ul>
            <li v-for="(key,value) in person" :key="item">{{value}}-->{{key}}</li>
        </ul>
    </div>
    <script>

        Vue.config.productionTip = false

        const vm = new Vue({
            el:'#app',
            data(){
                return{
                    person:{
                        name:'lisi',
                        age:18,
                        score:{
                            math: 60,
                            English: 80
                        }
                    }
                }
            },
            methods:{
                handler(){
                    // this.person.name = '小梅'
                    // this.person = {...this.person,age:30}
                    // this.person.sex = '男'
                    // this.$set(this.person,'sex','男')
                    // Vue.set(this.person,'sex','男')
                    // delete this.person.age
                    // this.$delete(this.person,'age')
                    // Vue.delete(this.person,'age')
                    delete this.person.age;
                    this.person = { ...this.person}
                }
            }
        })
    </script>
</body>
</html>